package com.cqhfan.core.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Collections;
import java.util.List;

@Data
@AllArgsConstructor
public class PageDTO<T> {

    private Long pages;

    private Long total;

    private List<T> records;

    public static <T> PageDTO<T> of(Long pages, Long total, List<T> records) {
        return new PageDTO<>(pages, total, records);
    }

    public static <T> PageDTO<T> empty() {
        return new PageDTO<T>(0L, 0L, Collections.emptyList());
    }

}
